<!--  -->
<template>
  <div class="prop-box pad-24">
      <div class="pr center" >
           <div class="f-32 f-w-500">补单详情</div>
           <van-icon @click="closewin()" name="cross" class="pa cross" />
      </div>
       <div class="mag-t-10 f-30">
           <ul v-if="detaiList">
               <li v-for="(v,k) in detaiList" :key="k" >
                   <div class="mag-b-20" >
                       <div class="f-30 fiex">
                           <div v-if="v.payType==2">消费{{v.price|fmtAmount}}元 <span class="f-24 c999">(包含手续费{{v.fee|fmtAmount}}元)</span></div>
                           <div v-if="v.payType==1">到账{{v.arrivalPrice|fmtAmount}}元 <span class="f-24 c999">(包含手续费{{v.fee|fmtAmount}}元)</span></div>
                           <div class="fiex1">
                               <div v-if="v.state==0" class="fr c-hui  pr red dot-bth dot-red mag-r-10">失败</div>
                               <div v-if="v.state==1" class="fr c-hui  pr blue dot-bth dot-blue mag-r-10">待执行</div>
                               <div v-if="v.state==2" class="fr c-hui  pr blue dot-bth dot-blue mag-r-10">执行中</div>
                               <div v-if="v.state==3" class="fr c-hui  pr green dot-bth dot-green mag-r-10">完成</div>
                               <div v-if="v.state==4" class="fr c-hui  pr org dot-bth dot-org mag-r-10">已中断</div>
                           </div>
                        </div>
                       <div class="f-30"><span class="f-24 c999">{{new Date(v.executeTime).format("yyyy-MM-dd hh:mm:ss")}}</span></div>
                       <div v-if="v.msg&&v.state==0" class="f-26 red">失败原因: <span>{{v.msg}}</span></div>
                   </div>
               </li>
           </ul>
       </div>
  </div>
</template>

<script>
var self = "";
export default {
  props:['planId'],
  data() {
    return {
        detaiList:"",
    };
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {
       self = this;
  },
  //生命周期 - 挂载完成（访问DOM元素）
  async mounted() {
   
    var cardDetial = await self.$axiosFun('/plan/planDetail/repairDetail',{
        orderNo:self.planId
    },'get');
    if(cardDetial.code==1000){
            self.detaiList = cardDetial.data;
    }else{
        self.$toast(cardDetial.message);
    }
    console.log(cardDetial)
  },
  methods:{
      closewin(){
          this.$emit('closewin')
      }
  }
};
</script>
<style scoped>
/* @import url(); 引入css类 */
@import './index.css'
</style>